<!DOCTYPE html>
<html>
<head>
    <title>五宝回收</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel="stylesheet" href="${s.base}/mobile/css/weui.min.css">
    <link rel="stylesheet" href="${s.base}/mobile/css/jquery-weui.min.css">
    <link rel="stylesheet" href="${s.base}/mobile/css/base.css">
    <link rel="stylesheet" href="${s.base}/mobile/css/component.css?1232445">
    <style type="text/css">
		body,html{background: #e4e4e4;}
    </style>
</head>
<!-- 企业下单 -->
<body>
<div style="width:100%;height:auto;"><img src="/mobile/images/banner2.jpg"></div>
<div class="xyg-comp-form">
       <div class="xyg-comp-form-item-one">
            <div class="xyg-comp-form-item-title"> 
             联系电话
            </div>
            <div class="xyg-comp-form-item-content"> 
             <input type="text" id="phone" placeholder="请先填写联系电话" />
            </div>
            <div class="clearBoth"></div>
       </div> 
       <div class="xyg-comp-form-item-one">
            <div class="xyg-comp-form-item-title"> 
             上门地址
            </div>
            <div class="xyg-comp-form-item-content"> 
             <input type="text" id="address" placeholder="请先填写上门地址" />
            </div>
            <div class="clearBoth"></div>
       </div>
       <div class="xyg-comp-form-item-one">
            <div class="xyg-comp-form-item-title"> 
             预约时间
            </div>
            <div class="xyg-comp-form-item-icon">
             <!--<span>请选择预约时间</span>-->
             <input type="text" id='reserveTime' placeholder="请选择预约时间"/>
             <svg class="icon" aria-hidden="true"> 
              <use xlink:href="#iconxiangyou"></use>
             </svg> 
            </div> 
            <div class="clearBoth"></div>
       </div> 
      <div class="xyg-comp-form-item">
             <div class="xyg-comp-form-item-textarea-content"> 
             <textarea class="fontStyle1" id="content" placeholder="请描述回收物的种类和重量（可回收物重量不能低于10公斤）" ></textarea>
            </div>
            <div class="xyg-comp-form-item-upload"> 
                <div class="xyg-comp-form-item-upload-pic" id="uploaderFiles" data-objectId="">
                </div>
                <div class="xyg-comp-form-item-upload-btn"> 
                	<img src="${s.base}/mobile/images/icon_upload.png"/>
                    <div class="upload-title">照片</div>
                    <input id="file" name="file" class="weui-uploader__input" type="file" accept="image/*" multiple onchange="cytImgUpload('file','','uploaderFiles',9,2)">
                </div>
                <div class="clearBoth"></div>
            </div>
       </div> 
       <!--<div class="xyg-comp-form-tip">
             <input id="checkContract" type="checkbox"/>统一《环保协议》的所得税法水电费水电费水电费是否对
       </div> -->
       <input type="button" id="save" class="xyg-btn-one color-bs margin-top-1rem" value="卖废品"/>
  	</div>
</body>
<script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script src="${s.base}/mobile/js/jquery-2.1.4.js"></script>
<script src="${s.base}/mobile/js/jquery-weui.js"></script>
<script src="${s.base}/mobile/fonts/iconfont.js"></script>
<script src="${s.base}/mobile/js/component.js"></script>
<script src="${s.base}/mobile/js/base.js"></script>
<script src="${s.base}/mobile/js/ajaxfileupload.js"></script>


<!--js分享代码开始-->
<input type="hidden" value="${jSTicketShareResponse.appid}" id="appid" />
<input type="hidden" value="${jSTicketShareResponse.fxTitle}" id="fxTitle" />
<input type="hidden" value="${jSTicketShareResponse.fxImgUrl}" id="fxImgUrl" />
<input type="hidden" value="${jSTicketShareResponse.fxDesc}" id="fxDesc" />
<input type="hidden" value="${jSTicketShareResponse.fxUrl}" id="fxUrl" />
<input type="hidden" value="${jSTicketShareResponse.nonceStr}" id="nonceStr" />
<input type="hidden" value="${jSTicketShareResponse.timestamp}" id="timestamp" />
<input type="hidden" value="${jSTicketShareResponse.signature}" id="signature" />
<script src="${s.base}/mobile/js/share.js"></script>
<script type="text/javascript">
    var memberId = '${memberId}';
    $("#reserveTime").datetimePicker();
    $("#save").on("click", function () {
        /*if($('#checkContract').is(':checked') == false) {
            $.toast("请同意环保协议", "text");
            return false;
        }*/
        var name = $("#name").val();
        if (name == null || name == "") {
            $.toast("请先填写姓名", "text");
            return false;
        }
        var phone = $("#phone").val();
        if (phone == null || phone == "") {
            $.toast("请先填写联系电话", "text");
            return false;
        }
        if (!(/^1(3|4|5|7|8)\d{9}$/.test(phone))) {
            $.toast("手机号码有误，请重填", "text");
            return false;
        }
        // 小区名称
        var address = $("#address").val();
        if (address == null || address == "") {
            $.toast("请先填写上门地址", "text");
            return false;
        }
        var reserveTime = $("#reserveTime").val();
        if (reserveTime == null || reserveTime == "") {
            $.toast("请选择预约时间", "text");
            return false;
        }
        var content = $("#content").val();
        if (content == null || content == "") {
            $.toast("请描述回收物的内容", "text");
            return false;
        }
        // 图片
        var imageArr = [];
        $("#uploaderFiles img").each(function () {
            var image = $(this).attr("src");
            imageArr.push(image)
        });
        var param = {
            name: name,
            memberId: memberId,
            phone: phone,
            address: address,
            reserveTime: reserveTime,
            content: content,
            type: '1',
            status: '1',
            image: imageArr.join(",")
        };
        $.showLoading("正在提交中");
        $.post("/phone/recoveryCircleOrderSave", param, function (result) {
            if (0 == result.code) {
                // showLayerAlertNoRefre("操作成功！");
                $.hideLoading();
                $.alert("提交成功",function () {
                    goFistPage(memberId);
                });
            } else {
                $.hideLoading();
                $.alert(result.msg);
            }
        }, "json");
    });
</script>
</html>
